package com.atguigu.gmallsugar.mapper;

import com.atguigu.gmallsugar.bean.Kw;
import com.atguigu.gmallsugar.bean.Traffic;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TrafficMapper {
    @Select("select toHour(stt) as hour, sum(pv_ct) as pv," +
            " sum(uv_ct) as uv, sum(sv_ct) as sv" +
            " from dws_traffic_vc_ch_ar_is_new_page_view_window" +
            " where toYYYYMMDD(stt)=#{date} group by toHour(stt)")
    List<Traffic> traffic(Integer date);

    @Select("select keyword,sum(keyword_count) as keyword_count " +
            " from dws_traffic_keyword_page_view_window " +
            " where toYYYYMMDD(stt)=#{date} group by keyword")
    List<Kw> kw(Integer date);
}
